package com.decades.application.dto;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import android.os.Parcel;
import android.os.Parcelable;
import android.provider.MediaStore.Audio.PlaylistsColumns;

public class BlogDto implements Parcelable{
	/**
	 * 
	 */
	
	private String title;
	private String content;
	private String author_name;
	private String id;
	private Date create_date;
	private String mindmap;
	private List<ReferenceDto> refList;
	
	public BlogDto() {
	}
	
	public BlogDto(Parcel in) { 
		readFromParcel(in); 
	}
	
	
	
	public String getTitle() {
		return title;
	}



	public void setTitle(String title) {
		this.title = title;
	}



	public String getContent() {
		return content;
	}



	public void setContent(String content) {
		this.content = content;
	}



	public String getAuthor_name() {
		return author_name;
	}



	public void setAuthor_name(String author_name) {
		this.author_name = author_name;
	}



	public String getId() {
		return id;
	}



	public void setId(String id) {
		this.id = id;
	}



	public Date getCreate_date() {
		return create_date;
	}



	public void setCreate_date(Date create_date) {
		this.create_date = create_date;
	}



	public String getMindmap() {
		return mindmap;
	}



	public void setMindmap(String mindmap) {
		this.mindmap = mindmap;
	}



	public List<ReferenceDto> getRefList() {
		return refList;
	}



	public void setRefList(List<ReferenceDto> refList) {
		this.refList = refList;
	}



	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}
	@Override
	public void writeToParcel(Parcel dest, int flags) {
		// TODO Auto-generated method stub
		dest.writeString(title);
		dest.writeString(content);
		dest.writeString(author_name);
		dest.writeString(id);
		dest.writeLong(create_date.getTime());
		dest.writeString(mindmap);
		dest.writeList(refList);
		
	}
	
	private void readFromParcel(Parcel in) {
		title = in.readString();
		content = in.readString();
		author_name = in.readString();
		id = in.readString();
		create_date = new Date(in.readLong());
		mindmap = in.readString();
		in.readList(refList,List.class.getClassLoader());
	}
	
	@SuppressWarnings("rawtypes")
	public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
        public BlogDto createFromParcel(Parcel parcel) {
           
            return new BlogDto(parcel);
        }

        public BlogDto[] newArray(int size) {
            return new BlogDto[size];
        }
    };
}
